/*
* $Id: Database.cpp 146 2010-09-20 19:41:07Z volok-aleksej@yandex.ru $
*
* Copyright 2008-2010 by Volokitin Alexey
* All rights reserved
*
*/
#include "Common/include.h"
#include "Database.h"
#include "QueryResult.h"
#include "Database/DatabaseNames.h"

CDatabase::CDatabase(const std::tstring& strDatabaseName)
: m_strDatabaseName(strDatabaseName){}
CDatabase::~CDatabase(){}
MyTable CDatabase::ExecRequest(const std::tstring& strSqlRequest){
	std::tstring strTemp(strSqlRequest.begin(), strSqlRequest.begin() + 6);
	if(strTemp == _T("SELECT"))
		return g_QR.GetResult();
	return MyTable();
}
bool CDatabase::IsExistTable(const std::tstring& strTableName){
	return TRUE;
}
void CDatabase::BeginTransaction(const std::tstring& strNameTransaction){}
void CDatabase::EndTransaction(const std::tstring& strNameTransaction){}
bool CDatabase::IsOpen(){
	return m_bOpen;
}
void CDatabase::Open(){
	if(!m_bOpen)
		m_bOpen = true;
}
std::tstring CDatabase::GetDatabaseName(){
	return m_strDatabaseName;
}
void CDatabase::Free(){
	delete this;
}
